const express = require( 'express' );
const adminRouter = require( './router/admin' );

const app = express();
app.listen( 8080 );

app.use( ( req, res, next ) => { 
    console.log('中间件1');
} );

app.use( ( req, res, next ) => { 
    console.log('中间件2');
} );

app.use( require( './router' ) );

app.use( '/admin', adminRouter );

app.use( ( req, res ) => { 
    res.status( 404 ).send( '404' );
})